\(\int \frac {\tan ^3(c+d x) (a B+b B \tan (c+d x))}{a+b \tan (c+d x)} \, dx\) [298]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [B] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 34, antiderivative size = 29 \[ \int \frac {\tan ^3(c+d x) (a B+b B \tan (c+d x))}{a+b \tan (c+d x)} \, dx=\frac {B \log (\cos (c+d x))}{d}+\frac {B \tan ^2(c+d x)}{2 d} \]

[Out]

B*ln(cos(d*x+c))/d+1/2*B*tan(d*x+c)^2/d

Rubi [A] (verified)

Time = 0.02 (sec) , antiderivative size = 29, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.088, Rules used = {21, 3554, 3556} \[ \int \frac {\tan ^3(c+d x) (a B+b B \tan (c+d x))}{a+b \tan (c+d x)} \, dx=\frac {B \tan ^2(c+d x)}{2 d}+\frac {B \log (\cos (c+d x))}{d} \]

[In]

Int[(Tan[c + d*x]^3*(a*B + b*B*Tan[c + d*x]))/(a + b*Tan[c + d*x]),x]

[Out]

(B*Log[Cos[c + d*x]])/d + (B*Tan[c + d*x]^2)/(2*d)

Rule 21

Int[(u_.)*((a_) + (b_.)*(v_))^(m_.)*((c_) + (d_.)*(v_))^(n_.), x_Symbol] :> Dist[(b/d)^m, Int[u*(c + d*v)^(m +
 n), x], x] /; FreeQ[{a, b, c, d, n}, x] && EqQ[b*c - a*d, 0] && IntegerQ[m] && ( !IntegerQ[n] || SimplerQ[c +
 d*x, a + b*x])

Rule 3554

Int[((b_.)*tan[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[b*((b*Tan[c + d*x])^(n - 1)/(d*(n - 1))), x] - Dis
t[b^2, Int[(b*Tan[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n, 1]

Rule 3556

Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-Log[RemoveContent[Cos[c + d*x], x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps \begin{align*} \text {integral}& = B \int \tan ^3(c+d x) \, dx \\ & = \frac {B \tan ^2(c+d x)}{2 d}-B \int \tan (c+d x) \, dx \\ & = \frac {B \log (\cos (c+d x))}{d}+\frac {B \tan ^2(c+d x)}{2 d} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.02 (sec) , antiderivative size = 26, normalized size of antiderivative = 0.90 \[ \int \frac {\tan ^3(c+d x) (a B+b B \tan (c+d x))}{a+b \tan (c+d x)} \, dx=\frac {B \left (2 \log (\cos (c+d x))+\tan ^2(c+d x)\right )}{2 d} \]

[In]

Integrate[(Tan[c + d*x]^3*(a*B + b*B*Tan[c + d*x]))/(a + b*Tan[c + d*x]),x]

[Out]

(B*(2*Log[Cos[c + d*x]] + Tan[c + d*x]^2))/(2*d)

Maple [A] (verified)

Time = 0.04 (sec) , antiderivative size = 30, normalized size of antiderivative = 1.03

method result size
derivativedivides \(\frac {B \left (\frac {\left (\tan ^{2}\left (d x +c \right )\right )}{2}-\frac {\ln \left (1+\tan ^{2}\left (d x +c \right )\right )}{2}\right )}{d}\) \(30\)
default \(\frac {B \left (\frac {\left (\tan ^{2}\left (d x +c \right )\right )}{2}-\frac {\ln \left (1+\tan ^{2}\left (d x +c \right )\right )}{2}\right )}{d}\) \(30\)
parallelrisch \(-\frac {-B \left (\tan ^{2}\left (d x +c \right )\right )+B \ln \left (1+\tan ^{2}\left (d x +c \right )\right )}{2 d}\) \(31\)
norman \(\frac {B \left (\tan ^{2}\left (d x +c \right )\right )}{2 d}-\frac {B \ln \left (1+\tan ^{2}\left (d x +c \right )\right )}{2 d}\) \(33\)
risch \(-i B x -\frac {2 i B c}{d}+\frac {2 B \,{\mathrm e}^{2 i \left (d x +c \right )}}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{2}}+\frac {B \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}{d}\) \(60\)

[In]

int(tan(d*x+c)^3*(B*a+b*B*tan(d*x+c))/(a+b*tan(d*x+c)),x,method=_RETURNVERBOSE)

[Out]

1/d*B*(1/2*tan(d*x+c)^2-1/2*ln(1+tan(d*x+c)^2))

Fricas [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 31, normalized size of antiderivative = 1.07 \[ \int \frac {\tan ^3(c+d x) (a B+b B \tan (c+d x))}{a+b \tan (c+d x)} \, dx=\frac {B \tan \left (d x + c\right )^{2} + B \log \left (\frac {1}{\tan \left (d x + c\right )^{2} + 1}\right )}{2 \, d} \]

[In]

integrate(tan(d*x+c)^3*(B*a+b*B*tan(d*x+c))/(a+b*tan(d*x+c)),x, algorithm="fricas")

[Out]

1/2*(B*tan(d*x + c)^2 + B*log(1/(tan(d*x + c)^2 + 1)))/d

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 53 vs. \(2 (24) = 48\).

Time = 0.57 (sec) , antiderivative size = 53, normalized size of antiderivative = 1.83 \[ \int \frac {\tan ^3(c+d x) (a B+b B \tan (c+d x))}{a+b \tan (c+d x)} \, dx=\begin {cases} - \frac {B \log {\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{2 d} + \frac {B \tan ^{2}{\left (c + d x \right )}}{2 d} & \text {for}\: d \neq 0 \\\frac {x \left (B a + B b \tan {\left (c \right )}\right ) \tan ^{3}{\left (c \right )}}{a + b \tan {\left (c \right )}} & \text {otherwise} \end {cases} \]

[In]

integrate(tan(d*x+c)**3*(B*a+b*B*tan(d*x+c))/(a+b*tan(d*x+c)),x)

[Out]

Piecewise((-B*log(tan(c + d*x)**2 + 1)/(2*d) + B*tan(c + d*x)**2/(2*d), Ne(d, 0)), (x*(B*a + B*b*tan(c))*tan(c
)**3/(a + b*tan(c)), True))

Maxima [A] (verification not implemented)

none

Time = 0.39 (sec) , antiderivative size = 30, normalized size of antiderivative = 1.03 \[ \int \frac {\tan ^3(c+d x) (a B+b B \tan (c+d x))}{a+b \tan (c+d x)} \, dx=\frac {B \tan \left (d x + c\right )^{2} - B \log \left (\tan \left (d x + c\right )^{2} + 1\right )}{2 \, d} \]

[In]

integrate(tan(d*x+c)^3*(B*a+b*B*tan(d*x+c))/(a+b*tan(d*x+c)),x, algorithm="maxima")

[Out]

1/2*(B*tan(d*x + c)^2 - B*log(tan(d*x + c)^2 + 1))/d

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 187 vs. \(2 (27) = 54\).

Time = 0.57 (sec) , antiderivative size = 187, normalized size of antiderivative = 6.45 \[ \int \frac {\tan ^3(c+d x) (a B+b B \tan (c+d x))}{a+b \tan (c+d x)} \, dx=-\frac {B \log \left ({\left | -\frac {\cos \left (d x + c\right ) + 1}{\cos \left (d x + c\right ) - 1} - \frac {\cos \left (d x + c\right ) - 1}{\cos \left (d x + c\right ) + 1} + 2 \right |}\right ) - B \log \left ({\left | -\frac {\cos \left (d x + c\right ) + 1}{\cos \left (d x + c\right ) - 1} - \frac {\cos \left (d x + c\right ) - 1}{\cos \left (d x + c\right ) + 1} - 2 \right |}\right ) + \frac {B {\left (\frac {\cos \left (d x + c\right ) + 1}{\cos \left (d x + c\right ) - 1} + \frac {\cos \left (d x + c\right ) - 1}{\cos \left (d x + c\right ) + 1}\right )} + 6 \, B}{\frac {\cos \left (d x + c\right ) + 1}{\cos \left (d x + c\right ) - 1} + \frac {\cos \left (d x + c\right ) - 1}{\cos \left (d x + c\right ) + 1} + 2}}{2 \, d} \]

[In]

integrate(tan(d*x+c)^3*(B*a+b*B*tan(d*x+c))/(a+b*tan(d*x+c)),x, algorithm="giac")

[Out]

-1/2*(B*log(abs(-(cos(d*x + c) + 1)/(cos(d*x + c) - 1) - (cos(d*x + c) - 1)/(cos(d*x + c) + 1) + 2)) - B*log(a
bs(-(cos(d*x + c) + 1)/(cos(d*x + c) - 1) - (cos(d*x + c) - 1)/(cos(d*x + c) + 1) - 2)) + (B*((cos(d*x + c) +
1)/(cos(d*x + c) - 1) + (cos(d*x + c) - 1)/(cos(d*x + c) + 1)) + 6*B)/((cos(d*x + c) + 1)/(cos(d*x + c) - 1) +
 (cos(d*x + c) - 1)/(cos(d*x + c) + 1) + 2))/d

Mupad [B] (verification not implemented)

Time = 7.51 (sec) , antiderivative size = 28, normalized size of antiderivative = 0.97 \[ \int \frac {\tan ^3(c+d x) (a B+b B \tan (c+d x))}{a+b \tan (c+d x)} \, dx=-\frac {B\,\left (\ln \left ({\mathrm {tan}\left (c+d\,x\right )}^2+1\right )-{\mathrm {tan}\left (c+d\,x\right )}^2\right )}{2\,d} \]

[In]

int((tan(c + d*x)^3*(B*a + B*b*tan(c + d*x)))/(a + b*tan(c + d*x)),x)

[Out]

-(B*(log(tan(c + d*x)^2 + 1) - tan(c + d*x)^2))/(2*d)